﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.CRM
{
    public partial class FormCRM客户一览 : DevExpress.XtraEditors.XtraForm
    {
        private List<CommonUserDTO> commonUserDTOs = new List<CommonUserDTO>();
        public FormCRM客户一览()
        {
            InitializeComponent();
            commonUserDTOs.Add(new CommonUserDTO("123","123","123",123,"123","123"));
            this.gridControl沉睡用户.DataSource = this.commonUserDTOs;
        }

        private void gridView沉睡用户_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            new FormCRM客户详细资料().ShowDialog();
        }

        private void gridView活跃用户_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            new FormCRM客户详细资料().ShowDialog();
        }

        private void gridView关键用户_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            new FormCRM客户详细资料().ShowDialog();
        }

        private void 关联客户ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new FormCRM客户详细资料().ShowDialog();
        }

    }

    /// <summary>
    /// 关键用户
    /// </summary>
    class KeyUserDTO
    {
        public String phone { get; set; }//电话
        public String name { get; set; }//姓名
        public String gender { get; set; }//性别
        public Double payment { get; set; }//累计消费
        public Double referPayment { get; set; }  //  关键客户引流累计消费
        public DateTime lastUVTime { get; set; }//上次消费时间
        public String lastUVMethod { get; set; }//上次消费路径

        public List<CommunicationRecordDTO> communicationRecordDTOs { get; set; }    //  沟通记录

        public KeyUserDTO()
        {

        }
    }

    /// <summary>
    /// 沉睡用户和活跃用户
    /// </summary>
    class CommonUserDTO
    {
        public String phone { get; set; }//电话
        public String name { get; set; }//姓名
        public String gender { get; set; }//性别
        public Double payment { get; set; }//累计消费
        public String lastUVTime { get; set; }//上次消费时间
        public String lastUVMethod { get; set; }//上次消费路径

        public List<CommunicationRecordDTO> communicationRecordDTOs { get; set; }    //  沟通记录

        public CommonUserDTO()
        {

        }

        public CommonUserDTO(string phone, string name, string gender, double payment, String lastUVTime, string lastUVMethod)
        {
            this.phone = phone;
            this.name = name;
            this.gender = gender;
            this.payment = payment;
            this.lastUVTime = lastUVTime;
            this.lastUVMethod = lastUVMethod;
        }
    }
    /// <summary>
    /// 沟通记录
    /// </summary>
    class CommunicationRecordDTO
    {
        public String id { get; set; }//
        public DateTime createDate{ get; set; }//
        public String saleAssitant { get; set; }//店员
        public String result { get; set; }//沟通结果

        public Double payment { get; set; } //  金额

        public String styleName { get; set; }   //  款式

        public String materialCode { get; set; }    //  面料号
    }
}
